package edu.hcnu.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component

// 负责 properties  注入
@PropertySource("classpath:application.properties")
public class Teacher {
    @Value("${teacher.name}")
    private String name;
    @Value("${teacher.age}")
    private int age;
    @Value("${teacher.subject}")
    private List<String> subject;
    @Autowired
    private Computer computer;

    @Value("#{${teacher.map}}")
    private Map<String,String> map;
}
